//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_domcommandingmenuexec.sqf"
#include "x_setup.sqf"

__TRACE_1("","_this");

if (!alive player || {GV(player,xr_pluncon)} || {__pGetVar(GVAR(isinaction))}) exitWith {showCommandingMenu ""};
GVAR(commandingMenuIniting) = true;
showCommandingMenu "";
switch (_this) do {
	case 0: {GVAR(commandingMenuCode) = {call FUNC(showstatus)}};
	case 1: {
		GVAR(commandingMenuCode) = {
			_artar = switch (GVAR(player_can_call_arti)) do {
				case 2: {[2, GVAR(AriTarget2)]};
				default {[1, GVAR(AriTarget)]};
			};
			_artar spawn FUNC(artillery);
		};
	};
	case 2: {GVAR(commandingMenuCode) = {0 spawn FUNC(calldrop)}};
	case 3: {GVAR(commandingMenuCode) = {0 spawn FUNC(spawn_trench)}};
	case 4: {GVAR(commandingMenuCode) = {0 spawn FUNC(spawn_mgnest)}};
	case 5: {GVAR(commandingMenuCode) = {0 spawn FUNC(spawn_mash)}};
	case 6: {GVAR(commandingMenuCode) = {0 spawn FUNC(spawn_farp)}};
	case 7: {GVAR(commandingMenuCode) = {call FUNC(adminspectateActionM)}};
	case 15: {GVAR(commandingMenuCode) = {"Chemlight_green" call FUNC(attachchemlight)}};
	case 16: {GVAR(commandingMenuCode) = {"Chemlight_red" call FUNC(attachchemlight)}};
	case 17: {GVAR(commandingMenuCode) = {"Chemlight_yellow" call FUNC(attachchemlight)}};
	case 18: {GVAR(commandingMenuCode) = {"Chemlight_blue" call FUNC(attachchemlight)}};
	case 20: {GVAR(commandingMenuCode) = {call FUNC(detachchemlight)}};
};
GVAR(DomCommandingMenuBlocked) = false;